package com.rickpan.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.rickpan.entity.WorkCategory;

import java.time.LocalDateTime;

/**
 * 工作分类响应DTO
 */
public class WorkCategoryResponse {

    private Long id;
    private Long userId;
    private String name;
    private String description;
    private String color;
    private String icon;
    private Boolean isSystem;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    // 构造函数
    public WorkCategoryResponse() {}

    public WorkCategoryResponse(WorkCategory category) {
        this.id = category.getId();
        this.userId = category.getUserId();
        this.name = category.getName();
        this.description = category.getDescription();
        this.color = category.getColor();
        this.icon = category.getIcon();
        this.isSystem = category.getIsSystem();
        this.createdAt = category.getCreatedAt();
    }

    // Getter 和 Setter 方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Boolean getIsSystem() {
        return isSystem;
    }

    public void setIsSystem(Boolean isSystem) {
        this.isSystem = isSystem;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
}
